package com.moneywelcome.riskassembly.apiImpl;

public class Singleton {
    private volatile static Singleton unique;
    public Singleton(){

    }
    public static Singleton getInstance(){
        if(unique==null){
            //类对象加锁
            synchronized (Singleton.class){

                if(unique==null){
                    unique=new Singleton();

                }
            }
        }
        return unique;
    }
}
